<template>
	<view>
		<SclBeforeResultLoadPage :isMBTI="endPageType == 'A0'" :tit="loadPageTit" @loadOk="loadOkHandle" />
	</view>
</template>

<script>
	import SclBeforeResultLoadPage from '@/subcontractorD/components/SclBeforeResultLoadPage.vue';
	export default {
		components: {
			SclBeforeResultLoadPage,
		},
		data() {
			return {
				loadPageTit: '',
				sourceType: '',
				from: '',
				sclId: '',
				reportId: '',
				sclReportType: ''
			}
		},
		onLoad(options) {
			if (options.from) {
				this.from = options.from
			}
			if (options.loadPageTit) {
				this.loadPageTit = options.loadPageTit
			}
			if (options.sourceType) {
				this.sourceType = options.sourceType
			}
			if (options.sclId) {
				this.sclId = options.sclId
			}
			if (options.reportId) {
				this.reportId = options.reportId
			}
			if (options.sclReportType) {
				this.sclReportType = options.sclReportType
			}
		},
		methods: {
			loadOkHandle() {
				if (this.sclReportType == 3) {
					uni.redirectTo({
						url: `/subcontractorD/pages/sexualityAssessmentNewPayPage/sexualityAssessmentNewPayPage?from=${this.from}&sourceType=${this.sourceType}&sclId=${this.sclId}&reportId=${this.reportId}`
					})
				} else if (this.sclReportType == 2) {
					uni.redirectTo({
						url: `/subcontractorD/pages/checkupDepressedNewPayPage/checkupDepressedNewPayPage?from=${this.from}&sourceType=${this.sourceType}&sclId=${this.sclId}&reportId=${this.reportId}`
					})
				} else if (this.sclReportType == 1) {
					uni.redirectTo({
						url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=${this.from}&sourceType=${this.sourceType}&sclId=${this.sclId}&reportId=${this.reportId}`
					})
				}
			}
		}
	}
</script>

<style>

</style>